#include "multiboot.h"
#include "monitor.h"
#include "timer.h"
#include "panic.h"

int main(struct multiboot *mboot_ptr, u32int initial_stack)
{
	
	/*
	 * TODO: Enable monitoring for displaying debug data.
	 */
	int vgaRet = vga_init();
	vgaRet = -1;
	if (vgaRet == -1)
	{
		//reboot
	}
	clear();
	printf("Starting kernel!\n");
	printhex(0xdeadbeef); //just for testing

	/*
	 * TODO: init PANIC!!!
	 * TODO: DIE!!!!!!!!!!
	 */

	/*
	 * TODO: Copy data from bootloader memory to kernel memory.
	 * This is because bootloader memory will probably be overwritten.
	 * Putting the multiboot structure in kernel memory will preserve the data.
	 */
	
	/*
	 * TODO: Prepare FS 
	 */

	/*
	 * TODO: Load initrd
	 */

	/*
	 * TODO: Load IRC's into memory.
	 */

	/*
	 * TODO: Load the GDT and IDT into the CPU from kernel image.
	 */
	// Load IDT
	// Load GDT

	/*
	 * TODO: Create timer
	 */
	timer_init(1000); // 1000 is prety mutch, but may be better for testing, bcause you can see the delay.

	/*
	 * TODO: Load system calls
	 */

	/*
	 * TODO: Enable paging.
	 */

	/*
	 * TODO: Enable multitasking
	 */

	/*
	 * TODO: Create first process (load /sbin/init image).
	 */

	printf("\nDone!");

	while(1);

	return 0;
}
